<template>
  <div>
    <Header></Header>
    <!-- 路由组件的出口 -->
    <router-view></router-view>
    <!-- 在Home或者Search是显示的，在登录，注册隐藏 -->
    <Footer v-show="$route.meta.show"></Footer>
  </div>
</template>

<script>
//引入Header
import { mapState, mapActions, mapMutations, mapGetters } from 'vuex'
import Header from './components/Header/index'
import Footer from './components/Footer/index.vue'
export default {
  components: { Header, Footer },
  mounted() {
    //通知vuex发请求，获取数据，存储在vuex中
    this.$store.dispatch("home/category");
  },
}
</script>

<style lang="scss" scoped></style>